<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/react.development.js"></script>
    <script src="../js/react-dom.development.js"></script>
    <script src="../js/babel.min.js"></script>
</head>

<body>
    <div id="app"></div>
    <input type="text" id="input">

    <script>
        document.getElementById('input').onblur = (e) => console.log(e);
    </script>
    <script type="text/babel">
        const handleClick = (event) => {
            console.log("event",event,event.pageX,event.PageY)
            alert(event.target.innerHTML)
        }
        const handleChange = (e) => console.log(e)
        const handleBlur = (e) => console.log(e)
        const handleClick2 = (e) => e.preventDefault()
        const vDom=(
            <div>
                <button onClick={handleClick}>点击我</button>
                <br/>
                <input type="text" onChange={handleChange} onBlur={handleBlur}/>
                <br/>
                <br/>
                <a href="http://www.baidu.com" onClick={handleClick2}>去百度</a>    
            </div>
        )
        //渲染虚拟DOM
        ReactDOM.render(vDom,document.getElementById('app'))
    </script>
</body>

</html>